{% extends "base.html" %}
{% block content %}



<script type="text/javascript" src="/static/ckeditor/ckeditor.js"></script>

<div id="main">

    <div id="side_tag" style="float: right">
        <ul>
            <h2> 标签</h2>
            <hr>
            <li><a href="/tag/python">python</a></li>
            <li><a href="/tag/nginx">nginx</a></li>
            <li><a href="/tag/tomcat">tomcat</a></li>
            <li><a href="/tag/mysql">mysql</a></li>
            <li><a href="/tag/redis">redis</a></li>
            <li><a href="/tag/xtracebackup">xtracebackup</a></li>
            <li><a href="/tag/flask">flask</a></li>
        </ul>
    </div>

    {% for post in posts.items %}

    <div class="main-left">
        <img src="/uploads/{{post.User.avator}}">
        <a href="{{url_for('user',username=post.User.username)}}"><p>{{post.User.username}}</p></a>
    </div>
    <div class="main-center">
        <a href="{{url_for('blog',id=post.Post.id)}}"><h3>{{post.Post.title}}</h3></a>
        <p>{{post.Post.summary}}</p>
    </div>
    {% endfor %}
</div>
<div id="main">
    <div class="main-left" style="height: auto">
        {% if posts.has_prev %}<a href="{{ url_for('index', page = posts.prev_num) }}"><< 上一页</a>{% else %}<< 上一页{% endif %} |
        {% if posts.has_next %}<a href="{{ url_for('index', page = posts.next_num) }}">下一页 >></a>{% else %}下一页 >>{% endif %}
    </div>
</div>

{% endblock %}